package com.xiaoqi.springboot.controller;

import com.xiaoqi.springboot.bean.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @Author Rookie Coder
 * @Description
 * @Date
 **/
//@Controller
@RestController  //
public class UserController {

    @RequestMapping("/springBootMVC")
//    @ResponseBody
    public Object sbAndSMC1(){
        User user = new User();
        user.setId(1);
        user.setName("小柒");
        user.setAge(12);
        return user;
    }

//    @RequestMapping(value = "/springBootMVC",method = RequestMethod.GET)
    @GetMapping("/springBootMVC") // 该注解，就相当于上边的注解指定该方法只能用GET请求
    public Object sbAndSMC2(){
        User user = new User();
        user.setId(1);
        user.setName("小柒");
        user.setAge(12);
        return user;
    }
}
